package com.wufan.day03;

/**
 * @author SongWufan
 * @date 2021/3/8 20:44
 */
public class ValueTransferTest2 {
    public static void main(String[] args) {
        Data data = new Data();
        data.m = 10;
        data.n = 20;
        ValueTransferTest2 valueTransferTest2 = new ValueTransferTest2();
        valueTransferTest2.swap(data);
        System.out.println("m"+data.m+"n"+data.n);
        //交换m和n的值
    }

    public void swap(Data data){
        int temp = data.m;
        data.m = data.n;
        data.n = temp;
    }
}

class Data{
    int m;
    int n;
}
